package com.fooddiary.service;

import com.fooddiary.util.AppException;
import com.fooddiary.web.form.RegistrationForm;
import com.fooddiary.web.form.UserProfileForm;

/**
 * Define operations for user registration, changing user profile e.t.s <br>
 * @author Created by andrey.kuznetsov <br>
 * @author Last modified by $Author$ <br>
 * @author Last modified on $Date$ at revision $Revision$ <br>
 */
public interface IUserService {

	/**
	 * Registers new user in system <br> 
	 * @param p_form - form with all registration data; {@link RegistrationForm} <br>
	 * @return registration form; {@link RegistrationForm} <br>
	 * @throws Exception -  if exception occur <br>
	 */
	public RegistrationForm registerNewUser(RegistrationForm p_form) throws Exception;
	
	/**
	 * Fills user profile form by user details <br>
	 * @return user profile form; {@link UserProfileForm} <br>
	 * @throws AppException - if exception occur <br>
	 */
	public UserProfileForm initUserProfileForm() throws AppException;
	
	/**
	 * Save user profile <br>
	 * @param p_form - user profile form; {@link UserProfileForm} <br>
	 * @return user profile form; {@link UserProfileForm} <br>
	 * @throws AppException - if exception occur
	 */
	public UserProfileForm saveUserProfile(UserProfileForm p_form) throws AppException;

}
